package appnode;

import java.util.Date;
import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;
import com.google.appengine.api.datastore.Key;
import com.google.appengine.api.datastore.Key;
import com.google.appengine.api.datastore.KeyFactory;
import appnode.Node;


@PersistenceCapable
public class Interface {
	@PrimaryKey
    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
    private Key key;

@Persistent
private String name;

@Persistent
private String protocol;

@Persistent
private String direction;

@Persistent
private String link;

@Persistent
private String frominterface;

@Persistent
private Date date;

@Persistent
private Node node;


public Interface(String name, String protocol, String direction, Date date) {
	this.name = name;
	this.protocol = protocol;
	this.direction = direction;
	this.date = date;
}

//getters
public Key getKey() {
	return key;
}

public String getName() {
	return name;
}

public String getProtocol() {
	return protocol;
}

public String getDirection(){
	return direction;
}

public Node getNode() {
	return node;
}

public String getLink() {
	return link;
}

public String getFrominterface() {
	return frominterface;
}

public String getKeyStr() {
	return KeyFactory.keyToString(key);
}

public Key getStrKey() {
	return KeyFactory.stringToKey(frominterface);
}

public Date getDate() {
	return date;
}


//setters

public void setName(String name) {
	this.name = name;
}

public void setProtocol(String protocol) {
	this.protocol = protocol;
}

public void setDirection(String direction){
	this.direction = direction;
}

public void setLink(String link){
	this.link = link;
}

public void setFrominterface(String frominterface){
	this.frominterface = frominterface;
}


public void setDate(Date date){
	this.date = date;
}

}